package auctionhaus

class Bid {
    Double amount
    Date dateCreated
    
    Customer bidder
    
    static belongsTo = [listing: Listing]

    static constraints = {
        // amount must not be blank
        amount blank: false

        // date created must not be blank
        dateCreated blank: false

        // bidder must not be blank
        bidder blank: false

        // listing must not be blank but can be null
        listing blank: true, nullable: true
    }
}
